<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>设置</title>
    <link rel="stylesheet" href="../css/aui.2.0.css">
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/common1.css">
    <link rel="stylesheet" href="../css/alert.css">
    <link rel="stylesheet" href="../css/set.css">
</head>
<body>
<header class="aui-bar aui-bar-nav">
    <a class="aui-pull-left aui-btn">
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title">设置</div>
</header>
<nav>
    <div class="member-info-entry">
        <ul class="member-info-list">
            <li>
                <a href="javascript:;" class="display-box">
                    <span>当前版本</span>
                    <span>V1.0</span>
                </a>
            </li>
            <li>
                <a href="javascript:;" class="display-box">
                    清除缓存
                </a>
            </li>
            <li>
                <a href="aboutus.html" class="display-box">
                    关于我们
                </a>
            </li>

        </ul>
    </div>
    <div class="out-login">退出登录</div>
</nav>

<script src="../js/jquery-3.0.0.min.js"></script>
<script src="../js/common.js"></script>
<script src="../js/function.js"></script>
<script src="../js/alert.js"></script>
<script src="../js/set.js"></script>
<script>
    $(document).on('click','.out-login',function () {
    	alert('11');
        dialog.confirm({
            title: "确认要退出吗?",
            content: "",
            ok: function () {
                /**
                 * 判断是iOS或是安卓，改变数据的获取方式
                 * */
                var ua = navigator.userAgent.toLowerCase();
                if (/iphone|ipad|ipod/.test(ua)) {
					ioscleanToken();
                } else {
                    cleanToken();
                }

            },
            cancel: function () {

            }
        })
    });

    function loginOut() {
        var token=localStorage.getItem('token');
        localStorage.removeItem('token');
        $('.get-token').html(token);
        //alert('调用这个方法辣。');
        setTimeout(function () {
            dialog.tusiSuccess('退出成功');
        }, 500);
    }


    //调用Android方法
    function cleanToken() {
        window.huifa.loginOut();
    }
	function ioscleanToken(){
		window.webkit.messageHandlers.loginOut.postMessage();
	}

</script>
</body>
</html>